package com.tiny.cqzcp.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tiny.cqzcp.dao.RecNumbersDao;
import com.tiny.cqzcp.dao.UserNumbersDao;
import com.tiny.cqzcp.pojo.RecNumber;
import com.tiny.cqzcp.pojo.UserNumbers;
import com.tiny.cqzcp.service.RecommendService;

/**
 * @author jmz
 */
@Service
public class RecommendServiceImpl implements RecommendService {
	

	private RecNumbersDao recDao;
	private UserNumbersDao userDao;

	@Autowired
	public RecommendServiceImpl(RecNumbersDao recDao,UserNumbersDao userDao){
		this.recDao = recDao;
		this.userDao = userDao;
	}

	@Override
	public void insertRecommendNumber(RecNumber numbers) {
		recDao.insert(numbers);
	}

	@Override
	public void batchInsert(List<RecNumber> lists) {
		recDao.batchInsert(lists);
	}

	@Override
	public List<RecNumber> queryRecAllRecords(RecNumber record) {
		return recDao.selectAll(record);
	}

	@Override
	public void batchUpdate(List<RecNumber> lists) {
		recDao.batchUpdate(lists);
	}

	@Override
	public void batchUpdateUserNumbers(List<UserNumbers> lists) {
		userDao.batchUpdate(lists);
	}

	@Override
	public List<UserNumbers> queryUserAllRecords(UserNumbers record) {
		return userDao.selectAll(record);
	}

	@Override
	public List<UserNumbers> queryUserAllRecordsByOrderId(UserNumbers record) {
		return userDao.selectByOrderId(record);
	}

	@Override
	public int updateUserNumber(UserNumbers record) {
		return userDao.updateByPrimaryKey(record);
	}

	@Override
	public UserNumbers queryUserRecRecordsByRId(UserNumbers record) {
		return userDao.selectByRId(record);
	}

}
